﻿using System;

namespace Xamarin.Forms.Shapes
{
    [ContentProperty("Segments")]
    public sealed class PathFigure : BindableObject, IAnimatable
    {
        public PathFigure()
        {
            Segments = new PathSegmentCollection();
        }

        public static readonly BindableProperty SegmentsProperty =
            BindableProperty.Create(nameof(Segments), typeof(PathSegmentCollection), typeof(PathFigure), null);

        public static readonly BindableProperty StartPointProperty =
            BindableProperty.Create(nameof(StartPoint), typeof(Point), typeof(PathFigure), new Point(0, 0));

        public static readonly BindableProperty IsClosedProperty =
            BindableProperty.Create(nameof(IsClosed), typeof(bool), typeof(PathFigure), false);

        public static readonly BindableProperty IsFilledProperty =
            BindableProperty.Create(nameof(IsFilled), typeof(bool), typeof(PathFigure), true);

        public PathSegmentCollection Segments
        {
            set { SetValue(SegmentsProperty, value); }
            get { return (PathSegmentCollection)GetValue(SegmentsProperty); }
        }

        public Point StartPoint
        {
            set { SetValue(StartPointProperty, value); }
            get { return (Point)GetValue(StartPointProperty); }
        }

        public bool IsClosed
        {
            set { SetValue(IsClosedProperty, value); }
            get { return (bool)GetValue(IsClosedProperty); }
        }

        public bool IsFilled
        {
            set { SetValue(IsFilledProperty, value); }
            get { return (bool)GetValue(IsFilledProperty); }
        }

        public void BatchBegin()
        {

        }

        public void BatchCommit()
        {

        }
    }
}